import 'package:flutter/material.dart';

class SliserDemo extends StatefulWidget {
  @override
  _SliserDemoState createState() => _SliserDemoState();
}

class _SliserDemoState extends State<SliserDemo> {
  double _sliderItemA = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('SliserDemo'),
        elevation: 0,
      ),
      body: Container(
        padding: EdgeInsets.all(16),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Slider(
                  value: _sliderItemA,
                  onChanged: (value) {
                    setState(() {
                      _sliderItemA = value;
                    });
                  },
                  activeColor: Theme.of(context).hintColor,
                  inactiveColor: Theme.of(context).hintColor.withOpacity(0.3),
                  min: 0,
                  max: 10,
                  divisions: 10,
                  label: '${_sliderItemA.toInt()}',
                ),
              ],
            )
          ],
        ),
      ),
    );
  }
}
